package com.zhijian.warehouse.manage.service;

import com.zhijian.util.page.Page;
import com.zhijian.warehouse.manage.entity.export.StoreInExport;
import com.zhijian.warehouse.manage.entity.po.StoreRecord;
import com.zhijian.warehouse.manage.entity.vo.request.StoreRecordSaveOrUpdateVo;
import com.zhijian.warehouse.manage.entity.vo.request.StoreRecordSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.StoreRecordVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 入库记录 业务处理层
 *
 * @author auto
 * @version 1.0
 * @date 2024-10-20 21:42:59
 */
public interface StoreRecordService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    StoreRecord selectById(Long id);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    StoreRecordVo selectVoById(Long id);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 按照主键批量删除
     *
     * @param idList
     */
    void deleteByIdList(List<Long> idList);

    /**
     * 新增
     *
     * @param storeRecord
     * @return
     */
    Long insert(StoreRecord storeRecord);

    /**
     * 动态新增
     *
     * @param storeRecord
     * @return
     */
    Long insertSelective(StoreRecord storeRecord);

    /**
     * 更改
     *
     * @param storeRecord
     * @return
     */
    boolean update(StoreRecord storeRecord);

    /**
     * 动态修改
     *
     * @param record
     * @return
     */
    boolean updateByPrimaryKeySelective(StoreRecord record);

    /**
     * 保存
     *
     * @param saveOrUpdateVo
     * @return
     */
    boolean save(StoreRecordSaveOrUpdateVo saveOrUpdateVo);

    /**
     * 编辑
     *
     * @param saveOrUpdateVo
     * @return
     */
    boolean modify(StoreRecordSaveOrUpdateVo saveOrUpdateVo);

    /**
     * 列表
     *
     * @param storeRecordSearchVo
     * @return
     */
    StoreRecordVo selectOne(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 总数
     *
     * @param storeRecordSearchVo
     * @return
     */
    Integer count(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 列表
     *
     * @param storeRecordSearchVo
     * @return
     */
    List<StoreRecordVo> selectList(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 分页查询
     *
     * @param storeRecordSearchVo
     * @return
     */
    Page<StoreRecordVo> selectPage(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities 实例对象列表
     * @return 影响行数
     */
    boolean insertBatch(List<StoreRecord> entities);

    /**
     * 查询出最新数据的number
     *
     * @return
     */
    String selectMaxNumber();

    /**
     * 生成下一个编码
     *
     * @return
     */
    String createNextNumber();

    /**
     * 审核
     * @param param
     * @return
     */
    boolean audit(StoreRecordSearchVo param,Integer sourceType);

    /**
     *
     * 提交审核
     * @param param
     * @return
     */
    boolean submitAudit(StoreRecordSaveOrUpdateVo param);

    /**
     * 导出入库记录
     * @param param
     * @return
     */
    List<StoreInExport> selectStoreInExportList(StoreRecordSearchVo param);
}